package com.qingyouchuxing.mall.biz.domain.entity;

import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;
import com.ruoyi.common.orm.core.domain.BaseEntity;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serial;
import java.math.BigDecimal;

@Data
@EqualsAndHashCode(callSuper = true)
@Table(value = "mall_goods_sku")
public class MallGoodsSku extends BaseEntity {
    @Serial
    private static final long serialVersionUID = 1L;

    /** 主键 */
    @Id
    private Long id;

    /**
     * sku名称
     */
    @NotBlank(message = "sku名称不能为空")
    private String skuName;

    /**
     * 描述说明
     */
    private String describe;

    /**
     * 价格因子
     */
    @NotNull(message = "价格因子不能为空")
    private BigDecimal priceFactor;

    /**
     * 库存
     */
    @Min(value = 0,message = "库存不能小于0")
    private Integer count;

    /**
     * 所属spu
     */
    @NotNull(message = "所属spu不能为空")
    private Long fkSpuId;
}
